
/*
import React from 'react';

export default class Counter extends React.Component {
    render(){
        // 注意这里的属性名是在 mapStateToProps 和 mapDispatchToProps 指定的
        const { value , increaseHandler: increase , decreaseHandler: decrease } = this.props ;
        return (
            <div>
                <p>{value}</p>
                <button onClick={increase}>点我增加</button>
                <button onClick={decrease}>点我减少</button>
            </div>
        )
    }
}
*/

import './counter.css';

export default function Counter(props){
    const { value , increaseHandler: increase , decreaseHandler: decrease } = props ;
    return (
        <div className="counter">
            <button onClick={increase}>点我增加</button>
            <button>{value}</button>
            <button onClick={decrease}>点我减少</button>
        </div>
    )
}